//
//  WCFindInProjectWindowController.h
//  WabbitCode
//
//  Created by William Towe on 3/9/09.
//  Copyright 2009 Revolution Software. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "WCTabViewContextProtocol.h"
#import "MGScopeBarDelegateProtocol.h"


#define kWCFindInProjectCurrentFileIdentifier NSLocalizedString(@"Current File",@"Current File")
#define kWCFindInProjectOpenFilesIdentifier NSLocalizedString(@"Open Files",@"Open Files")
#define kWCFindInProjectAllFilesIdentifier NSLocalizedString(@"All Files",@"All Files")

extern NSString *kWCProjectPrefsFindInProjectIgnoreCaseKey;
extern NSString *kWCProjectPrefsFindInProjectUseRegularExpressionsKey;
extern NSString *kWCProjectPrefsFindInProjectWindowFrameKey;
extern NSString *kWCProjectPrefsFindInProjectSplitViewDividerPositionKey;
extern NSString *kWCProjectPrefsFindInProjectFindRecentsKey;
extern NSString *kWCProjectPrefsFindInProjectReplaceRecentsKey;
extern NSString *kWCProjectPrefsFindInProjectScopeIdentifierKey;

@class PSMTabBarControl,WCProject,WCFindResult,WCTextFile;

@interface WCFindInProjectWindowController : NSWindowController <WCTabViewContext, MGScopeBarDelegate> {
	IBOutlet PSMTabBarControl *_psmTabBarControl;
	IBOutlet NSTabView *_tabView;
	IBOutlet NSTextField *_projectBuildStatusTextField;
	IBOutlet NSPopUpButton *_textViewActionButton;
	IBOutlet NSComboBox *_findComboBox;
	IBOutlet NSComboBox *_replaceComboBox;
	IBOutlet NSOutlineView *_outlineView;
	IBOutlet NSTextField *_projectStatusTextField;
	IBOutlet NSSplitView *_splitView;
	IBOutlet MGScopeBar *_mgScopeBar;
	IBOutlet NSButton *_lineColumnButton;
	IBOutlet NSPopUpButton *_textViewSymbolsActionPopUpButton;
	
	NSString *_findString;
	NSString *_replaceString;
	BOOL _ignoreCase;
	BOOL _useRegularExpressions;
	WCFindResult *_findResult;
	NSArray *_findRecents;
	NSArray *_replaceRecents;
	NSUInteger _numberOfFindResults;
	NSString *_findLastString;
	BOOL _shouldCancelFindAction;
	CGFloat _findProgressTotal;
	CGFloat _findProgress;
	
	struct _fipFlags {
		unsigned int isProcessing:1;
		unsigned int reserved:31;
		
	} _fipFlags;
}
@property (readonly) PSMTabBarControl *psmTabBarControl;
@property (readonly) NSTabView *tabView;
@property (readonly) WCProject *project;
@property (readwrite, assign) BOOL isProcessing;
@property (readwrite, copy) NSString *findString;
@property (readwrite, copy) NSString *replaceString;
@property (readwrite, assign) BOOL ignoreCase;
@property (readwrite, assign) BOOL useRegularExpressions;
@property (readonly) NSTextField *projectBuildStatusTextField;
@property (readonly) NSTextField *projectStatusTextField;
@property (readwrite, retain) WCFindResult *findResult;
@property (readonly) NSSplitView *splitView;
@property (readwrite, copy) NSArray *findRecents;
@property (readwrite, copy) NSArray *replaceRecents;
@property (readonly) MGScopeBar *mgScopeBar;
@property (readwrite, assign) NSUInteger numberOfFindResults;
@property (readwrite, copy) NSString *findLastString;
@property (readwrite, retain) NSString *scopeIdentifier;
@property (readwrite, assign) BOOL shouldCancelFindAction;
@property (readwrite, assign) CGFloat findProgress;
@property (readwrite, assign) CGFloat findProgressTotal;

- (IBAction)findAction:(id)sender;
- (IBAction)replaceAction:(id)sender;
@end
